<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/sys/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<%@ include file="/WEB-INF/adminui/include/css.jsp" %>
<title>仓库列表</title>
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox">
				<div class="ibox-body">
					<div class="fixed-table-toolbar">
						<div id="toolbar" class="columns pull-left">
							<qx:perm code="repertory_ADD"> 
							<button type="button" class="btn btn-primary" onclick="add()">
								<i class="fa fa-plus hidden" aria-hidden="true"></i>添加
							</button>
							</qx:perm>
							<qx:perm code="repertory_DEL">
							<button type="button" class="btn btn-danger multi" onclick="del()">
								<i class="fa fa-trash hidden" aria-hidden="true"></i>删除
							</button>
							</qx:perm>
						</div>
						<div class="columns pull-right">
							<button class="btn btn-success" onclick="UiList.loadTable()">查询</button>
						</div>
						<div class="columns pull-right col-md-2 nopadding">
							<input id="searchName" type="text" class="form-control" placeholder="按名称查询">
						</div>
						<div class="columns pull-right col-md-2 nopadding" style="width:125px;margin-right:5px;">
							<select id="repertoryid" class="form-control">
								<option value="">--选择仓库--</option>
								<c:forEach items="${repertoryrs}" var="repertory">
								<option value="${repertory.repertoryid}">${repertory.name}</option>
								</c:forEach>
							</select>
						</div>
					</div>
					<table id="dataTable" data-mobile-responsive="true">
					</table>
				</div>
			</div>
		</div>
	</div>
</div>
<%@ include file="/WEB-INF/adminui/include/script.jsp" %>
<script type="text/javascript">
$(function(){
	UiList.render({
		tableConfig:{
			url: "${path}/gi/listdata.json",
			idfield: 'giid',
			columns: [
				{checkbox : true},
				{field : 'repertoryName', title : '仓库名称'},
				{field : 'resName', title : '物品名称'},
				{field : 'ginum', title : '库存总数'},
				{field : 'inNum', title : '入库总数'},
				{field : 'outNum', title : '出库总数'}
			]
		},
		tableParams: function(){//搜索条件
			return {searchname: $("#searchName").val(),repertoryid : $("#repertoryid").val()};
		}
	});
	
});
</script>
</body>
</html>